package com.novax.ex.activity.provider.service;

import com.novax.ex.activity.infrastructure.entity.RankRule;
import com.novax.ex.activity.infrastructure.mapper.RankRuleMapper;
import com.novax.ex.common.base.BaseMapper;
import com.novax.ex.common.base.BaseService;
import org.springframework.stereotype.Service;

import jakarta.annotation.Resource;
import java.util.List;

/**
 * @Description
 * @Author ChenXi
 * @Date 2023/11/23/15:46
 */
 

@Service
public class RankRuleService extends BaseService {

    @Resource
    private RankRuleMapper rankRuleMapper;

    @Override
    protected BaseMapper getBaseMapper() {
        return rankRuleMapper;
    }

    /**
     * @param rankId
     * @Description: 规则列表
     * @Author: ChenXi
     * @Date: 2023/11/24 10:38
     * @return: java.lang.Object
     **/
    public List<RankRule> ruleList(Long rankId) {
        return rankRuleMapper.ruleList(rankId);
    }

    /**
     * @Description: 查询是否已有配置
     * @Author: ChenXi
     * @Date:  2023/11/24 15:10
     * @param rankId
     * @param language
     * @return: com.novax.ex.activity.infrastructure.entity.RankRule
     **/
    public RankRule findByRankIdAndLanguage(Long rankId, String language) {
        return rankRuleMapper.findByRankIdAndLanguage(rankId, language);
    }

}
